public class project1 {
    private int age;
    public void setAge(int a){
        if (a>=18&&a<=35){
            age=a;
        }else {
            System.out.println("数据不合法");
        }
    }
    public int getAge(){
        return age;
    }
}
